﻿

using IotContract.Dtos.Servers;
using IotContract.Models.Clients;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IotContract.Interfaces;
/// <summary>
/// 设备采集启动入口
/// </summary>
public interface IClientMainManager
{

    /// <summary>
    /// 启动设备采集
    /// </summary>
    /// <param name="equips"></param>
    /// <returns></returns>
    Task<bool> Run(List<IotEquipDto> equips);
    /// <summary>
    /// 启动设备
    /// </summary>
    /// <param name="equip"></param>
    /// <returns></returns>
    Task<bool> Run(IotEquipDto equip);
    /// <summary>
    /// 停止设备采集
    /// </summary>
    /// <param name="equips"></param>
    /// <returns></returns>
    Task<bool> Stop(List<IotEquipDto> equips);
    /// <summary>
    /// 停止设备采集
    /// </summary>
    /// <param name="programId"></param>
    /// <returns></returns>
    Task<bool> Stop(long programId);
    /// <summary>
    /// 停止所有
    /// </summary>
    /// <returns></returns>
    Task<bool> Stop();
    /// <summary>
    /// 推送和写入数据
    /// </summary>
    /// <returns></returns>
    Task PushAndWirte();

    /// <summary>
    /// 异步流读取所有程序控制指令
    /// </summary>
    /// <param name="command"></param>
    /// <param name="token"></param>
    /// <returns></returns>
    IAsyncEnumerable<ClientControlCommand> ReadControl(ClientRequestCommand command, CancellationToken token);


}
